package mx.netbrain.dao.impl;

import mx.netbrain.dao.StatusDao;
import mx.netbrain.model.Status;
import mx.netbrain.util.HibernateUtil;

import org.hibernate.Query;
import org.hibernate.Session;

public class StatusDaoImpl implements StatusDao {

	@Override
	public Status findByStatus(String status) {
		Session session = HibernateUtil.getSessionFactory().openSession();
		String sql = "select status from Status status where status.status=:status";
		Query query = session.createQuery(sql);
		query.setString("user", status);
		return (Status) query.uniqueResult();
	}

}
